< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03100300.xhp

(section: cdate) (bookmark: bm_id3150772)
CDate function

CDate 関数

CDate Function [Runtime]
CDate 関数 [実行時](hd_id3150772.1)

Converts any string or numeric expression to a date value.
文字列および数値表式を、日付データに変換します。(par_id3150986.2)

(/section: cdate)

Syntax:
構文:(hd_id3148944.3)

CDate (Expression)
CDate (Expression)(par_id3148947.4)

Return value:
戻り値:(hd_id3148552.5)

Date
日付(par_id3159414.6)

Parameters:
パラメータ:(hd_id3153525.7)

Expression: Any string or numeric expression that you want to convert.
Expression: 日付データに変換する文字列および数値表式。(par_id3150359.8)

When you convert a string expression, the date and time must be entered in the format MM.DD.YYYY HH.MM.SS, as defined by the DateValue and TimeValue function conventions. In numeric expressions, values to the left of the decimal represent the date, beginning from December 31, 1899. Values to the right of the decimal represent the time.
文字列を変換する場合、その日付と時刻の表記は、DateValue および TimeValue 関数で使われる MM.DD.YYYY HH.MM.SS の形式で与える必要があります。数値表記を変換する場合、左側の数値が 1989 年 12 月 31 日から始まる日付を表し、数値の右側が時刻を表します。(par_id3125864.9)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3156422.10)

sub ExampleCDate
sub ExampleCDate(par_id3153969.11)

MsgBox cDate(1000.25) REM 09.26.1902 06:00:00
MsgBox cDate(1000.25) REM 1902 年9月 26 日 6時 00 分 00 秒 に該当する日付データ(par_id3159254.12)

MsgBox cDate(1001.26) REM 09.27.1902 06:14:24
MsgBox cDate(1001.26) REM 1902 年9月 27 日 6時 14 分 24 秒 に該当する日付データ(par_id3155133.13)

end sub
end sub(par_id3153140.14)


< Prev / Next >